package org.example.mallcommon.confing;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 韩先楚
 * es客户端配置
 */
@Configuration
public class ElasticsearchConfig {


    @Bean(destroyMethod = "close")
    public RestHighLevelClient client()
    {
        return new RestHighLevelClient(
                RestClient.builder(
                        new HttpHost("192.168.200.146", 9200, "http")
                )
        );
    }
}
